﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>矢量图层显示</title>
        <!--引入当前页面样式表-->
        <link href="./style.css" rel="stylesheet" type="text/css" />
        <script src="./static/libs/include-openlayers-local.js"></script>
        <script type="text/javascript">
            //定义地图文档图层和地图
            var VecLayer, map;

            /** 初始化地图显示*/
            function init() {
                //图层显示名称
                var name = 'MapGIS IGS VecLayer';
                //要显示的图层的gdbps地址
                var gdbps = [
                    'C:\\Users\\Administrator\\Documents\\WXWork\\1688852418315641\\Cache\\File\\2020-12\\公路通行圈\\bj_point_4h_1test_60.shp'
                ];
                //创建一个图层
                VecLayer = new Zondy.Map.GdbpLayer(name, gdbps, {
                    ip: '192.168.22.97',
                    port: '6163', //访问IGServer的端口号，.net版为6163，Java版为8089,
                    mapstyUri:
                        'C:\\Users\\Administrator\\Documents\\WXWork\\1688852418315641\\Cache\\File\\2020-12\\公路通行圈\\公路通行圈样式.mapsty',
                    mapstyOption: {
                        DefaultShow: true,
                        MapInfoShow: true,
                        DynamicAnnShow: true,
                        ThemeShow: true,
                        SrsShow: true,
                        SystemLibraryShow: true,
                        LayerMappingType: 1
                    }
                });
                console.log('VecLayer', VecLayer);
                //创建一个地图容器
                map = new ol.Map({
                    //目标DIV
                    target: 'mapCon',
                    //添加图层到地图容器中
                    layers: [VecLayer],
                    view: new ol.View({
                        center: [116.5, 39.75],
                        zoom: 9,
                        projection: 'EPSG:4326'
                    })
                });
            }
        </script>
    </head>
    <body onload="init()">
        <div id="mapCon" style="width: 100%; height: 95%; position: absolute"></div>
    </body>
</html>
